<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return redirect()->route('admin.home');
});

Auth::routes();

//Route::get('/home', 'HomeController@index')->name('home');
Route::get('/home', function () {
    return redirect()->route('webapp.home');
})->name('home');

/**
 * 前端路由重写
 * 登录和注册
 */
Route::get('/register', function () {
    return redirect()->to('/webapp#/register');
})->name('register');

Route::get('/login', function () {
    return redirect()->to('/webapp#/login');
})->name('login');

Route::get('/webapp/', 'WebApp\HomeController@index')
    ->middleware(['web', 'wechat.oauth'])
    ->name('webapp.home');

